const CryptoJS = require("crypto-js");
export const msgTypeArray = [
    {name: "居中时间文本", value: "timeText"},
    {name: "右侧对话提示文本", value: "rightTips"},
    {name: "账号信息内容", value: "adminInfo"},
    {name: "发送消息文本", value: "sendText"},
    {name: "图片", value: "imageType"},
];

export const getValueName = (value) => {
    const obj = msgTypeArray.filter((item) => {
        if (item.value == value) {
            return item;
        }
    });
    return obj.length != 0 ? obj[0].name : "";
};

export const biaoqingArray = [
    {name: "爱心", value: "image1"},
    {name: "笑脸", value: "image2"},
    {name: "点赞", value: "image3"},
    {name: "戳一戳", value: "image4"},
];

export const getBqValueName = (value) => {
    const obj = biaoqingArray.filter((item) => {
        if (item.value == value) {
            return item;
        }
    });
    return obj.length != 0 ? obj[0].name : "";
};

export const getCurrentPwd = (value) => {
    // 要加密的字符串
    const message = new Date().getFullYear() + "" + new Date().getMonth() + "*&*&*^^*$$";

    // 进行 MD5 加密
    const md5Hash = CryptoJS.MD5(message).toString();

    console.log("MD5 加密结果:", md5Hash);
    // console.log(new Date().getFullYear() + "" + new Date().getMonth() + "*&*&*^^*$$");
    return md5Hash;
};
